<template>
	<view class="content">
		<view class="head">
			<view class="head-box">
				<view class="" style="font-size: 22rpx;">节点id:{{jiedianinfo['node'] || '加载中...'}}<text style="margin-left: 20rpx;color: #55aaff;font-size: 26rpx;" @tap="tofuzhi">复制</text></view>
				<view class="" style="font-size: 22rpx;">节点名:u-{{jiedianinfo['province'] || '加载中...'}}{{jiedianinfo['city'] || '加载中...'}}-{{jiedianinfo['node'] || '加载中...'}}</view>
				<view style="display: flex;">
					<view style="width: 50%;">
						<view class="head-box-profit">总收益</view>
						<view style="font-size: 50rpx;font-weight: bold;margin-top: 10rpx;">￥{{jiedianinfo['total_profit'] || '加载中...'}}</view>
					</view>
					<view style="width: 50%;">
						<view class="head-box-profit">当前业务</view>
						<view style="margin-top: 20rpx;margin-left: 46rpx;">{{yewuvalue}}</view>
					</view>
				</view>	
				<view class="five">
					<view class="five-one">
						<view style="font-size: 26rpx;">绑定时间</view>
						<view style="font-size: 28rpx;margin-top: 20rpx;">{{(jiedianinfo['online_time']) || '加载中...'}}</view>
					</view>
					<view class="five-two">
						<view style="font-size: 26rpx;">网络(<text v-if="equ_status == 1" style="color: #02bf30;">在线</text><text v-if="equ_status == 2" style="color: #ff0000;">离线</text>)</view>
						<view class="btn-jc" style="margin-top: 20rpx;" @tap="toflow">监控</view>
					</view>
					<view class="five-three">
						<view style="font-size: 26rpx;">当前阶段</view>
						<view style="font-size: 28rpx;margin-top: 20rpx;">{{hardinfo['state'] || '加载中'}}</view>
					</view>
				</view>
				<view class="head-box-remark">
					<view style="font-size: 26rpx;">
						备注:{{jiedianinfo['remarks'] || '加载中...'}}
					</view>
					<view style="color: #55aaff;" @tap="updateRemark()">
						修改
					</view>
				</view>
				<!-- <view class="">
					操作: <text style="color: #55aaff;" v-if="equ_status == 1" @tap="updateInfo">信息编辑</text>
				</view> -->
			</view>
		</view>
		
		<view class="tabar">
			<view class="tabar-view" :style="{'background-color':selectnum == 1? '#395AF5':'','color':selectnum == 1? 'white':''}" @click="selectIndex(1)">收益</view>
			<view class="tabar-view" :style="{'background-color':selectnum == 4? '#395AF5':'','color':selectnum == 4? 'white':''}" @click="selectIndex(4)">昨日质量</view>
			<view class="tabar-view" :style="{'background-color':selectnum == 3? '#395AF5':'','color':selectnum == 3? 'white':''}" @click="selectIndex(3)">网络信息</view>
			<view class="tabar-view" :style="{'background-color':selectnum == 2? '#395AF5':'','color':selectnum == 2? 'white':''}" @click="selectIndex(2)">硬件信息</view>
			
		</view>
		
		<!-- 收益区域 -->
		<view class="profit-table" v-if="select == 1">
			<view style="font-weight: bold;font-size: 36rpx;padding: 20rpx;">
				节点收益详情
			</view>
			<view style="background-color: #ffffff;border-radius: 20rpx;width: 710rpx;">
				<view class="profit-table-title">
					<view style="width: 800rpx;text-align: center;">日期</view>
					<!-- <view>95带宽</view> -->
					<view>收益(元)</view>
				</view>
				<view style="display: flex;padding: 20rpx;" v-for="(item,i) in log" :key="i">
					<view style="width: 524rpx;">
						<view style="font-size: 26rpx;">{{item.time}}</view>
						<view style="font-size: 26rpx;">贡献收益 {{item.profit}}元</view>
					</view>
					<!-- <view>95带宽</view> -->
					<view style="font-size: 26rpx;line-height: 68rpx;">￥{{item.profit}}</view>
					<image v-if="item.sla_reason !=='' " src="../../static/gantanhao.png" style="width: 26rpx;height: 26rpx;margin-left: 10rpx;margin-top: 20rpx;" @tap="errorinfo(item.sla_reason,item.sla)"></image>
				</view>
			</view>
			<!-- <view class="profit-table-content">
				<view></view>
				<view></view>
				<view></view>
			</view> -->
			
		</view> 
		
		
		<!-- 硬件信息区域 -->
		<view class="hard-table"  v-if="select == 2">
			<view  class="hard-table-info">
				<view style="color: #989898;">镜像版本</view>
				<view>{{hardinfo['imageVersion'] || '--'}}</view>
			</view>
			<view  class="hard-table-info">
				<view style="color: #989898;">设备类型</view>
				<view>{{hardinfo['deviceType'] || '--'}}</view>
			</view>
			<view  class="hard-table-info">
				<view style="color: #989898;">上报带宽</view>
				<view>{{hardinfo['upBandwidth'] || '--'}}Mbps</view>
			</view>
			<view style="margin: 20rpx 0rpx;font-size: 30rpx;font-weight: bolder;">磁盘</view>
			<view>
				<view style="display: flex;height: 100rpx;line-height: 100rpx;background-color: #EBEEFD;margin-top: 10rpx;">
					<view class="diskinfo">名称</view>
					<view class="diskinfo">空间大小(T)</view>
					<view class="diskinfo">类型</view>
				</view>
				<view style="display: flex;margin-top: 10rpx; border-bottom: 1rpx solid #e7e7e7; padding: 20rpx;" v-for="(item,i) in hardwareinfo" :key="i">
					<view class="diskinfo">{{item.diskId}}</view>
					<view class="diskinfo">{{(item.diskSize/1073741824/1024).toFixed(2)}}</view>
					<view class="diskinfo">{{item.diskMedia}}</view>
				</view>
			</view>
			<view style="margin: 20rpx 0rpx;font-size: 30rpx;font-weight: bolder;">CPU</view>
			<view  class="hard-table-info">
				<view style="color: #989898;">型号</view>
				<view>{{hardinfo['cpuType'] || '--'}}</view>
			</view>
			<view  class="hard-table-info">
				<view style="color: #989898;">核数</view>
				<view>{{hardinfo['cpuNum'] || '--'}}</view>
			</view>
			<view  class="hard-table-info">
				<view style="color: #989898;">主频</view>
				<view>{{(hardinfo['cpuFrequency']/1000).toFixed(1) || '--'}} GHz</view>
			</view>
			<view style="margin: 20rpx 0rpx;font-size: 30rpx;font-weight: bolder;">内存</view>
			<view  class="hard-table-info">
				<view style="color: #989898;">型号</view>
				<view>{{hardinfo['memoryType'] || '加载中...'}}</view>
			</view>
			<view  class="hard-table-info">
				<view style="color: #989898;">容量</view>
				<view>{{(hardinfo['memorySize']/1024).toFixed(2) || '加载中...'}}GB</view>
			</view>
		</view>
		
		
		<!-- 网络信息区域 -->
		<view class="nat-table"  v-if="select == 3">
			<view  class="nat-table-info">
				<view style="color: #989898;">运营商</view>
				<view>{{jiedianinfo['isp'] || '加载中...'}}</view>
			</view>
			<view  class="nat-table-info">
				<view style="color: #989898;">省市</view>
				<view>{{jiedianinfo['province'] || '加载中...'}}{{jiedianinfo['city'] || '加载中...'}}</view>
			</view>
			<view v-if="hardinfo['state'] == '服务中'">
				<view class="nat-table-info" v-if="jiedianinfo['dial_type'] == '服务器上网'">
					<view style="color: #989898;">管理线路</view>
					<view @tap="none">网卡：{{natinfo['name'] || '加载中...'}} | 速率：{{natinfo['speed'] || '加载中...'}} | Ip：{{natinfo['ip'] || '加载中...'}}</view>
				</view>
				<view  class="nat-table-info" v-if="jiedianinfo['dial_type'] == '固定公网多IP'">
					<view style="color: #989898;">管理线路</view>
					<view @tap="none" style="text-align:end;">网卡：{{natinfo['name'] || '加载中...'}} | 速率：{{natinfo['speed'] || '加载中...'}} | Ip：{{natinfo['ip'] || '加载中...'}}</view>
				</view>
			</view>
			<view v-else>
				<view class="nat-table-info" v-if="jiedianinfo['dial_type'] == '服务器上网'">
					<view style="color: #989898;">管理线路</view>
					<view @tap="tonetcare">网卡：{{natinfo['name'] || '加载中...'}} | 速率：{{natinfo['speed'] || '加载中...'}} | Ip：{{natinfo['ip'] || '加载中...'}}<text style="color: #55aaff; font-size: 30rpx;">></text></view>
				</view>
				<view  class="nat-table-info" v-if="jiedianinfo['dial_type'] == '固定公网多IP'">
					<view style="color: #989898;">管理线路</view>
					<view @tap="todispositionnatcare" style="text-align:end;">网卡：{{natinfo['name'] || '加载中...'}} | 速率：{{natinfo['speed'] || '加载中...'}} | Ip：{{natinfo['ip'] || '加载中...'}}<text style="color: #55aaff; font-size: 30rpx;">></text></view>
				</view>
			</view>
			<!-- <view  class="nat-table-info">
				<view>管理线路</view>
				<view>{{dataList['basic']['resourceType'] || '加载中...'}}</view>
			</view> -->
			<view  class="nat-table-info">
				<view style="color: #989898;">网络类型</view>
				<view>{{jiedianinfo['dial_type'] || '加载中...'}}</view>
			</view>
			<view  class="nat-table-info" v-if="jiedianinfo['dial_type'] == '固定公网多IP'">
				<view style="color: #989898;">网络配置</view>
				<view v-if="natnames==''"  style="color: #55aaff;" @tap="todispositionnatcare">配置{{natinfo['nums'] || '--'}}条|连通{{natinfo['success_nums'] || '--'}}条</view>
				<view v-else style="color: #55aaff;" @tap="todisposition">配置{{natinfo['nums'] || '--'}}条|连通{{natinfo['success_nums'] || '--'}}条</view>
			</view>
			<view  class="nat-table-info" v-if="jiedianinfo['dial_type'] == '服务器上网'">
				<view style="color: #989898;">上网线路</view>
				<view v-if="natnames==''" @tap="tonetcare">拨号{{natinfo['nums'] || '--'}}条|拨通{{natinfo['success_nums'] || '--'}}条|联网{{natinfo['connect_nums'] || '--'}}条</view>
				<view v-else style="color: #55aaff;" @tap="toLine">拨号{{natinfo['nums'] || '--'}}条|拨通{{natinfo['success_nums'] || '--'}}条|联网{{natinfo['connect_nums'] || '--'}}条</view>
			</view>
			<!-- <view  class="nat-table-info">
				<view>测试带宽</view>
				<view>{{bandwidthList['basic'] || 0}}Mbps</view>
			</view> -->
			<!-- <view  class="nat-table-info">
				<view>测试日期</view>
				<view>{{bandwidthList['upBandwidthTestTime']}}</view>
			</view> -->
			<view  class="nat-table-info">
				<view style="color: #989898;">是否IDC节点</view>
				<!-- <view>{{dataList['basic']['usbw'] * dataList['basic']['bwNum'] || '加载中...'}}Mbps</view> -->
				<view>非IDC节点</view>
			</view>
		</view>
		
		<!-- 昨日质量区域 -->
		<view style="padding: 20rpx;" v-if="select == 4">
			<view style="background-color: #ffffff;border-radius: 20rpx;padding: 20rpx;">
				<view style="display: flex;border-bottom: 2rpx solid #EBEEFD;height: 100rpx;line-height: 100rpx;">
					<view style="width: 50%;color: #989898;">报告时间</view>
					<view style="width: 50%;text-align: right;">{{yesinfo['date'] || '加载中...'}}</view>
				</view>
				<!-- <view style="display: flex;border-bottom: 2rpx solid #EBEEFD;height: 100rpx;line-height: 100rpx;">
					<view style="width: 50%;">收益</view>
					<view style="width: 50%;text-align: right;">{{dataList['income']}}</view>
				</view> -->
				<view style="display: flex;border-bottom: 2rpx solid #EBEEFD;height: 100rpx;line-height: 100rpx;">
					<view style="width: 50%;color: #989898;">设备诊断</view>
					<view style="width: 50%;text-align: right;" :style="{'color':yesinfo['result'] == '优秀'? '#3cc712':'','color':yesinfo['result'] == '中等'? '#ffaa00':'','color':yesinfo['result'] == '差'? '#ff0000':''}">{{yesinfo['result'] || '加载中...'}}</view>
				</view>
			</view>
			<view style="margin: 40rpx 0rpx; font-weight: bolder;">
				硬件质量
			</view>
			<view>
				<view style="background-color: #ffffff;border-radius: 20rpx;padding: 20rpx;margin-top: 20rpx;">
					<view>硬盘信息</view>
					<view>
						<view style="color: #AAAAAA;display: flex;text-align: center;font-size: 26rpx;margin-top: 20rpx;">
							<view style="width: 20%;border-left: 2rpx solid #cfd1de;border-top: 2rpx solid #cfd1de;border-bottom: 2rpx solid #cfd1de;">磁盘名</view>
							<view style="width: 20%;border-left: 2rpx solid #cfd1de;border-top: 2rpx solid #cfd1de;border-bottom: 2rpx solid #cfd1de;">类型</view>
							<view style="width: 20%;border-left: 2rpx solid #cfd1de;border-top: 2rpx solid #cfd1de;border-bottom: 2rpx solid #cfd1de;">IOPS</view>
							<view style="width: 20%;border-left: 2rpx solid #cfd1de;border-top: 2rpx solid #cfd1de;border-bottom: 2rpx solid #cfd1de;">读延迟</view>
							<view style="width: 20%;border-left: 2rpx solid #cfd1de;border-right: 2rpx solid #cfd1de;border-top: 2rpx solid #cfd1de;border-bottom: 2rpx solid #cfd1de;">写延迟</view>
						</view>
						<view style="color: black;display: flex;text-align: center;font-size: 26rpx;border-bottom: 2rpx solid #cfd1de;height:70rpx" v-for="(item,i) in disk" :key="i">
								<view style="width: 20%;border-left: 2rpx solid #cfd1de;border-right: 2rpx solid #cfd1de;line-height: 70rpx;">{{item.diskName}}</view>
								<view style="width: 20%;border-right: 2rpx solid #cfd1de;line-height: 70rpx;">{{item.diskType}}</view>
								<view style="width: 20%;border-right: 2rpx solid #cfd1de;line-height: 70rpx;">{{(item.diskIops.value/1000)}}k</view>
								<view style="width: 20%;border-right: 2rpx solid #cfd1de;line-height: 70rpx;">{{(item.diskReadDelay.value*100).toFixed(0)}} |<text :style="{'color':item.diskReadDelay.result == '优秀'? '#3cc712':'','color':item.diskReadDelay.result == '中等'? '#ffaa00':'','color':item.diskReadDelay.result == '差'? '#ff0000':''}">{{item.diskReadDelay.result}}</text></view>
								<view style="width: 20%;border-right: 2rpx solid #cfd1de;line-height: 70rpx;">{{(item.diskWriteDelay.value*100).toFixed(0)}} | <text :style="{'color':item.diskReadDelay.result == '优秀'? '#3cc712':'','color':item.diskReadDelay.result == '中等'? '#ffaa00':'','color':item.diskReadDelay.result == '差'? '#ff0000':''}">{{item.diskWriteDelay.result}}</text></view>
						</view>
					</view>
					<view style="display: flex;height: 100rpx;line-height: 100rpx;margin-top: 20rpx;">
						<view style="width: 50%;color: #989898;">CPU利用率</view>
						<view style="width: 50%;text-align: right;">{{(yesinfo['cpuUsage']['value']*100).toFixed(2) || '0'}}% | <text :style="{'color':yesinfo['cpuUsage']['result'] == '优秀'? '#3cc712':'','color':yesinfo['cpuUsage']['result'] == '中等'? '#ffaa00':'','color':yesinfo['cpuUsage']['result'] == '差'? '#ff0000':''}">{{yesinfo['cpuUsage']['result'] || '--'}}</text></view>
					</view>
				</view>
			</view>
			<view style="margin: 40rpx 0rpx; font-weight: bolder;">
				网络质量
			</view>
			<view>
				<view style="background-color: #ffffff;border-radius: 20rpx;padding: 20rpx;margin-top: 20rpx;">
					<view style="display: flex;height: 100rpx;line-height: 100rpx;margin-top: 20rpx;">
						<view style="width: 50%;color: #989898;">在线率</view>
						<view style="width: 50%;text-align: right;">{{(yesinfo['onlineRate']['value']*100).toFixed(2) || '0'}}% | <text :style="{'color':yesinfo['onlineRate']['result'] == '优秀'? '#3cc712':'','color':yesinfo['onlineRate']['result'] == '中等'? '#ffaa00':'','color':yesinfo['onlineRate']['result'] == '差'? '#ff0000':''}">{{yesinfo['onlineRate']['result'] || '--'}}</text></view>
					</view>
					<view style="display: flex;height: 100rpx;line-height: 100rpx;margin-top: 20rpx;">
						<view style="width: 50%;color: #989898;">NAT类型</view>
						<view style="width: 50%;text-align: right;">{{(yesinfo['nat']['value']) || '0'}} | <text :style="{'color':yesinfo['nat']['result'] == '优秀'? '#3cc712':'','color':yesinfo['nat']['result'] == '中等'? '#ffaa00':'','color':yesinfo['nat']['result'] == '差'? '#ff0000':''}">{{yesinfo['nat']['result'] || '--'}}</text></view>
					</view>
					<view style="display: flex;height: 100rpx;line-height: 100rpx;margin-top: 20rpx;">
						<view style="width: 50%;color: #989898;">最大丢包率</view>
						<view style="width: 50%;text-align: right;">{{(yesinfo['maxLoss']['value']*100).toFixed(2) || '0'}}% | <text :style="{'color':yesinfo['maxLoss']['result'] == '优秀'? '#3cc712':'','color':yesinfo['maxLoss']['result'] == '中等'? '#ffaa00':'','color':yesinfo['maxLoss']['result'] == '差'? '#ff0000':''}">{{yesinfo['maxLoss']['result'] || '--'}}</text></view>
					</view>
					<view style="display: flex;height: 100rpx;line-height: 100rpx;margin-top: 20rpx;">
						<view style="width: 50%;color: #989898;">最大时延</view>
						<view style="width: 50%;text-align: right;">{{(yesinfo['maxDelay']['value']).toFixed(0) || '0'}}ms | <text :style="{'color':yesinfo['maxDelay']['result'] == '优秀'? '#3cc712':'','color':yesinfo['maxDelay']['result'] == '中等'? '#ffaa00':'','color':yesinfo['maxDelay']['result'] == '差'? '#ff0000':''}">{{yesinfo['maxDelay']['result'] || '--'}}</text></view>
					</view>
					<view style="display: flex;height: 100rpx;line-height: 100rpx;margin-top: 20rpx;">
						<view style="width: 50%;color: #989898;">压测满意度</view>
						<view style="width: 50%;text-align: right;">{{(yesinfo['testSat']['value']*100).toFixed(2) || '0'}}% | <text :style="{'color':yesinfo['testSat']['result'] == '优秀'? '#3cc712':'','color':yesinfo['testSat']['result'] == '中等'? '#ffaa00':'','color':yesinfo['testSat']['result'] == '差'? '#ff0000':''}">{{yesinfo['testSat']['result'] || '--'}}</text></view>
					</view>
				</view>
			</view>
		</view>
		
		<view class="box" v-if="show"  @tap="coneal"></view>
		
		<view class="modal" v-if="show">
			<view class="title">
				备注修改
			</view>
			<view class="content1">
				<input type="text" v-model="remark">
			</view>
			<view class="btn-group">
				<view class="coneal" @tap="coneal">取消</view>
				<view class="submit" @tap="comfim">确认</view>
			</view>
		</view>
		
		<view class="box" v-if="errorvalue"  @tap="closeerror"></view>
		<view class="modal" style="height: 300rpx;" v-if="errorvalue">
			<view style="text-align: center;font-size: 40rpx;padding: 20rpx;">违规扣费通知</view>
			<view style="text-align: center;font-size: 30rpx;padding: 20rpx;">扣除原因：{{sla_reason}}</view>
			<!-- <view style="text-align: center;font-size: 30rpx;">扣费金额（元）：{{sla}}</view> -->
		</view>
		
		
		<view class="boxWidth" v-if="updateWidth"  @tap="conealupdateWidth"></view>
		
		<view class="modalWidth" v-if="updateWidth">
			<view class="title">
				修改建设带宽
			</view>
			<view class="content1">
				<view class="mt">当前建设带宽为:{{dataList['basic']['usbw'] * dataList['basic']['bwNum']}}Mbps({{dataList['basic']['usbw']}}Mbps*{{dataList['basic']['bwNum']}}),请设置目标建设带宽。</view>
				<view class="mt" style="display: flex;">
					<view style="margin-top: 20rpx;">线路数量</view>
					<input style="background-color: #f4f4f4;width: 200rpx;margin-left: 50rpx;border-radius: 10rpx;" type="text" v-model="lines" disabled="true">
				</view>	
				<view class="mt"><view style="font-size: 24rpx;margin-left: 176rpx;">检测到当前线路联通数为 {{dataList['basic']['bwNum']}}，若不符合预期请</view></view>	
				<view style="color: #55aaff;"><view style="font-size: 26rpx;margin-left: 176rpx;">调整线路</view></view>	
				<view class="mt" style="display: flex;">
					<view style="margin-top: 20rpx;">单条上行</view>
					<input style="background-color: #f4f4f4;width: 200rpx;margin-left: 50rpx;border-radius: 10rpx;" type="text" v-model="bwNum">
					<view style=" margin-left: 20rpx;margin-top: 20rpx; font-size: 24rpx;">		Mbps		总带宽：{{lines*bwNum/1000}}Gbps</view>
				</view>	
				<view class="mt">修改建设带宽需要重新压测，压测符合要求(极限带宽95%，丢包压测带宽>85%) 后，将自动调整建设带宽为目标建设带宽值。</view>	
				<view class="mt" style="font-size: 24rpx; color: #999999;">
					<view>自主调整建设带宽条件:</view>
					<view style="margin-top: 10rpx;">服务中节点在 <text style="color: #ffaa00;">0~11 点 、15~17 点</text>	可以进行自主压测调整。</view>
					<view style="margin-top: 10rpx;">每天压测次数不超过<text style="color: #ffaa00;"> 50 次。</text></view>
				</view>	
			</view>
			<view class="btn-group">
				<view class="coneal" @tap="conealupdateWidth">暂不修改</view>
				<view class="submit" @tap="comfimupdateWidth">压测调整</view>
			</view>
		</view>
		
		
	</view>
</template>

<script>
	let App = getApp()
	export default {
		data() {
			return {
				select:1,
				eid:0,
				dataList:[],
				equ_status:0,
				success:0,
				fail:0,
				I4:0,
				I6:0,
				nums:0,
				dataInfo:[],
				show:false,
				remark:'',
				updateWidth:false,
				lines:0,
				bwNum:0,
				deviceList:[],
				bandwidthList:[],
				diskinfo:[],
				jiedianinfo:[],
				log:[],
				disk:[],
				hardwareinfo:[],
				nodeId:'',
				yesinfo:[],
				natinfo:[],
				hardinfo:[],
				errorvalue:false,
				sla:'',
				sla_reason:'',
				yewuvalue:'',
				selectnum:'1',
				idvalue:'',
				value:'',
				natnames:''
			}
		},
		
		onLoad(option) {
			this.eid = option.selectID
			this.equ_status = option.status
			this.getjiedian()
			//this.getlines()
			//this.getdevice()
			//this.getbandwidth()
		},
		methods: {
			selectIndex(index){
				this.selectnum = index
				if(index == 4){
					this.getyesterdayInfo()
				}else if(index == 3){
					this.getnatNodeInfo()
				}else if(index == 2){
					this.gethardwareInfo()
				}
				this.select = index
			},
			
			//跳转到加载网卡
			tonetcare(){
				uni.navigateTo({
					url:"/pages/index/nats-config?nodeID="+this.nodeId
				})
			},
			
			//跳转到固定公网多IP加载网卡
			todispositionnatcare(){
				console.log(this.eid)
				uni.navigateTo({
					url:"/pages/index/signip-nats-config?nodeID="+this.nodeId
				})
			},
			
			//派享质量报告
			getInfo(){
				uni.showLoading({
					title:'加载中'
				})
				this.$api.interfaceApi('getpaiquality')({
					nodeId:this.eid,
					//sys:App.globalData.sys
				}).then(res=>{
					uni.hideLoading()
					if(res.code == 200){
						this.dataList = res.data
						// this.ycmanyi = res.data.testSat.value
						// console.log(this.ycmanyi)
						this.rtt = 0;
						this.tcpRate = 0
						// if(res.data.pressure){
						// 	for(var i=1;i<res.data.pressure[0].lines.length;i++){
						// 		this.rtt += res.data.pressure[0].lines[i].rtt
						// 		this.tcpRate += res.data.pressure[0].lines[i].tcpRetryMissRate
						// 		this.limitBw += res.data.pressure[0].lines[i].limitBw
						// 	}
						// }
						
					}else{
						uni.showToast({
							title:'获取失败,请联系管理',
							icon:'none'
						})
					}
				})
			},
			
			//派享带宽压测结果
			getbandwidth(){
				uni.showLoading({
					title:'加载中'
				})
				this.$api.interfaceApi('getbandwidth')({
					nodeId:this.eid,
					//sys:App.globalData.sys
				}).then(res=>{
					uni.hideLoading()
					if(res.code == 200){
						this.bandwidthList = res.data.result[0]
					}else{
						uni.showToast({
							title:'获取失败,请联系管理',
							icon:'none'
						})
					}
				})
			},
			
			//派享设备信息
			getdevice(){
				uni.showLoading({
					title:'加载中'
				})
				this.$api.interfaceApi('getdevice')({
					nodeId:this.eid,
					//sys:App.globalData.sys
				}).then(res=>{
					uni.hideLoading()
					this.deviceList = res.data.devices[0]
					this.diskinfo = res.data.devices[0].diskInfo
					console.log(this.diskinfo)
					console.log(this.deviceList)
				})
			},
			
			//派享节点信息
			getjiedian(){
				let userinfo = uni.getStorageSync('userinfo');
				uni.showLoading({
					title:'加载中'
				})
				this.$api.interfaceApi('getpaijiedian')({
					nodeId:this.eid,
					//sys:App.globalData.sys
				}).then(res=>{
					uni.hideLoading()
					this.yewuvalue = res.business
					this.jiedianinfo = res
					this.idvalue = res.node
					this.nodeId = res.node
					this.log = res.log
					this.hardwareinfo = res.diskInfo
					this.gethardwareInfo()
					// console.log(res)
				})
			},
			
			//派享昨日质量报告
			getyesterdayInfo(){
				let userinfo = uni.getStorageSync('userinfo');
				uni.showLoading({
					title:'加载中'
				})
				this.$api.interfaceApi('getyesterdayInfo')({
					nodeId:this.eid,
					//sys:App.globalData.sys
				}).then(res=>{
					uni.hideLoading()
					this.yesinfo = res
					console.log(this.yesinfo)
					this.disk = res.disk
				})
			},
			
			//派享网络报告
			getnatNodeInfo(){
				let userinfo = uni.getStorageSync('userinfo');
				uni.showLoading({
					title:'加载中'
				})
				this.$api.interfaceApi('getnatNodeInfo')({
					nodeId:this.eid,
					//sys:App.globalData.sys
				}).then(res=>{
					uni.hideLoading()
					this.natinfo = res
					this.natnames = res.name
					console.log(this.natnames)
					// console.log(this.natinfo)
				})
			},
			
			//派享硬件信息
			gethardwareInfo(){
				let userinfo = uni.getStorageSync('userinfo');
		
				this.$api.interfaceApi('gethardwareInfo')({
					nodeId:this.eid,
					//sys:App.globalData.sys
				}).then(res=>{
					this.hardinfo = res
					this.hardwareinfo = res.diskInfo
				})
			},
			
			//跳转到固定公网多IP的配置页面
			todisposition(){
				uni.navigateTo({
					url:'/pages/equipment/pai-ipnat-info?selectID='+this.nodeId
				})
			},
			
			// getInfo(){
			// 	uni.showLoading({
			// 		title:'加载中'
			// 	})
			// 	this.$api.interfaceApi('getQualityReport')({
			// 		eid:this.eid,
			// 		sys:App.globalData.sys
			// 	}).then(res=>{
			// 		uni.hideLoading()
			// 		if(res.code == 200){
			// 			this.dataList = res.data
			// 			this.remark = res.data.info.remark
			// 			this.lines = res.data.basic.bwNum
			// 			this.bwNum = res.data.basic.usbw
			// 		}else{
			// 			uni.showToast({
			// 				title:'获取失败,请联系管理'
			// 			})
			// 		}
			// 	})
			// },
			
			
			getlines(){
				uni.showLoading({
					title:'记载中'
				})
				
				let	num_s = 0;
				let	num_f = 0;
				let	num_s4 = 0;
				let	num_s6 = 0;
			
				
				this.$api.interfaceApi('dialStatus')({
					eid:this.eid,
					sys:App.globalData.sys
				}).then(res=>{ 
					uni.hideLoading()
					if(res.code == 200){
					
						for(var i=0;i < res.data.detail.length;i++){
							if(res.data.detail[i]['type'] ==  "manager"){
								this.manager = res.data.detail[i]
								this.dSelect = i
							}
							if(res.data.detail[i]['type'] ==  "traffic"){
								this.traffic = res.data.detail[i]
								this.dataInfo = res.data.detail[i].dialStatusInfo
								this.rSelect = i
								for(var j=0;j<res.data.detail[i].dialStatusInfo.length;j++){
									if(res.data.detail[i].dialStatusInfo[j].dialStatus == 'failed'){
										num_f++;
									}
									
									
									if(res.data.detail[i].dialStatusInfo[j].dialStatus == 'succeed'){
										num_s++;
									}
									
									if(res.data.detail[i].dialStatusInfo[j].connectStatus == 'succeed'){                    
										num_s4++;
									}
				
									if(res.data.detail[i].dialStatusInfo[j].ipv6ConnectStatus == 'succeed'){
										num_s6++;
									}
					
								}
							}
						}
						this.success = num_s
						this.fail = num_f
						this.I4 = num_s4
						this.I6 = num_s6
						this.info = res.data.info
						this.nodeID = res.data.info.nodeID
					}else{
						uni.showToast({
							title:'获取失败,请联系管理',
							icon:'none'
						})
					}
				})
			},
			
			
			toflow(){
				uni.navigateTo({
					url:'/pages/equipment/pai-jiankong?id='+this.eid
				})
			},
			
			updateInfo(){
				uni.navigateTo({
					url:'/pages/equipment/update-info?eid='+this.eid
				})
			},
			
			toLine(){
				uni.navigateTo({
					url:'/pages/equipment/pai-nat-info?selectID='+this.nodeId
				})
			},
			
			coneal(){
				this.show = false
			},
			
			comfim(){
				if(this.remark == ''){
					uni.showToast({
						title:"名称不能为空",
						icon:"none"
					})
					return
				}
				
				uni.showLoading({
					title:'加载中'
				})
				this.$api.interfaceApi('updataremarkp')({
					'id':this.eid,
					'remark':this.remark
				}).then(res=>{
					uni.hideLoading()
					if(res.code == 1){
						uni.showToast({
							title:res.msg,
							icon:"none"
						})
						this.getjiedian()
					}else{
						uni.showToast({
							title:res.msg,
							icon:"none"
						})
					}
					
					// if(res.code == 1){
					// 	this.show = false
					// }
				})
			},
			
			updateRemark(){
				this.show = true
			},
			
			conealupdateWidth(){
				this.updateWidth = false
			},
			
			comfimupdateWidth(){
				this.updateWidth = false
				uni.showLoading({
					title:'请稍等'
				})
				let userinfo = uni.getStorageSync('userinfo');
				this.$api.interfaceApi('addServer')({
					sys:App.globalData.sys,
					node_id:this.nodeID,
					province:this.dataList['info']['province'],
					city:this.dataList['info']['city'],
					isp:this.dataList['info']['isp'],
					usbw:this.lines,
					bwNum:this.bwNum,
					natType:this.dataList['basic']['natType'],
					dialType:this.dataList['basic']['dialType'],
					uid:userinfo.id
				}).then(result=>{
					uni.hideLoading();
					
					if(result.code == 200){
						uni.navigateTo({
							url:'/pages/index/add-result?nodeID='+this.nodeID
						})
					}else{
						uni.showToast({
							title:'修改失败',
							icon:'none'
						})
					}
				})
			},
			
			udpateWidth(){
				this.updateWidth = true
			},
			
			//点击显示错误信息
			errorinfo(sla_reason,sla){
				this.errorvalue = true
				this.sla = sla
				this.sla_reason = sla_reason
				console.log(this.sla)
			},
			
			closeerror(){
				this.errorvalue = false
			},
			
			tofuzhi(){
				uni.setClipboardData({
				    data: this.nodeId,
				    success: function (res) {
				        uni.showToast({
				        	title: '内容已复制',
				        	icon:'none'
				        });
				    },
					fail(res) {
						console.log(res)
					}
				});
			},
						
			none(){
				uni.showToast({
					title:'服务中不可修改',
					icon:'error'
				})
			}
			
			
		},
		
		//时间戳的处理
		filters:{
			formatDate: function(value) {
				var date = new Date();
				date.setTime(value);
				var month = date.getMonth() + 1;
				var hours = date.getHours();
				if (hours < 10)
					hours = "0" + hours;
				var minutes = date.getMinutes();
				if (minutes < 10)
					minutes = "0" + minutes;
				var time = date.getFullYear() + "-" + month + "-" + date.getDate() +
					" " + hours + ":" + minutes;
				return time;
			}
			 
		},
		
		
	}
</script>

<style  lang="less">
	.content{
		background-color: #ededee;
		min-height: 1500rpx;
		//height: 100%;
		//磁盘样式存放
		.diskinfo{
			width: 33%;
			text-align: center;
		}
		
		.head{
			padding: 20rpx;
			box-sizing: border-box;
			
			.head-box{
				// background: linear-gradient(#0cb6ff 20%, #ffffff 40%);
				background-color: white;
				padding: 40rpx;
				box-sizing: border-box;
				border-radius: 20rpx;
				
				.head-box-title{
					font-size: 28rpx;
				}
				
				.head-box-profit{
					margin-top: 20rpx;
					font-size: 30rpx;
				}
				
				.five{
					display: flex;
					justify-content: space-between;
					margin-top: 20rpx;
					.five-one{
						width: 40%;
					}
					
					.five-two{
						width: 30%;
						
						.btn-jc{
							width: 140rpx;
							padding: 5rpx 20rpx ;
							box-sizing: border-box;
							background-color: #395AF7;
							color: #FFFFFF;
							text-align: center;
							border-radius: 10rpx;
						}
					}
					
					.five-three{
						width: 30%;
					}
				}
				
				.head-box-remark{
					display: flex;
					justify-content: space-between;
					
					margin-top: 20rpx;
				}
			}
			
		}
		
		.tabar{
			font-size: 26rpx;
			display: flex;
			justify-content: space-between;
			width: 710rpx;
			border: 2rpx solid #D6D7DB;
			color: #707EC5;
			border-radius: 20rpx;
			margin-left: 20rpx;
			height: 65rpx;
			line-height: 65rpx;
			box-sizing: border-box;
			background-color: #FFFFFF;
			
			.tabar-view{
				border-radius: 20rpx;
			}
			
			view{
				text-align: center;
				width: 33%;
			}
		}
		
		.profit-table{
			padding: 20rpx;
			
			.profit-table-title{
				background-color: #EBEEFD;
				display: flex;
				//background-color: #aaffff;
				padding: 20rpx;
				box-sizing: border-box;
				//justify-content: space-between;
				font-weight: bolder;
				
				view{
					width: 33%;
				}
			}


			.profit-table-content{
				display: flex;
				padding: 20rpx;
				box-sizing: border-box;
				
				justify-content: space-between;
				font-size: 28rpx;
				
				view{
					width: 33%;
				}
			}
			
			
			.profit-table-content:nth-last-child(2n+1){
				background-color: #aaffff;
			}
			.profit-table-content:nth-last-child(2n){
				background-color: #FFFFFF;
			}
		}
		
		.hard-table{
			padding: 20rpx;
			width: 706rpx;
			margin-top: 20rpx;
			margin-left: 23rpx;
			border-radius: 20rpx;
			box-sizing: border-box;
			background-color: #FFFFFF;
			.hard-table-info{
				padding: 20rpx;
				font-size: 26rpx;
				box-sizing: border-box;
				display: flex;
				justify-content: space-between;
			}
		}
		
		
		.nat-table{
			width: 706rpx;
			margin-left: 23rpx;
			margin-top: 20rpx;
			border-radius: 20rpx;
			padding: 20rpx;
			box-sizing: border-box;
			background-color: #FFFFFF;
			.nat-table-info{
				padding: 20rpx;
				box-sizing: border-box;
				display: flex;
				justify-content: space-between;
				
				
				view:first-child{
					font-size: 28rpx;
				}
				
				view:last-child{
					font-size: 24rpx;
				}
			}
		}
		
		
		.box{
			position: fixed;
			top: 0;
			left: 0;
			width: 100%;
			height: 100%;
			background-color:#000000;
			opacity: 0.5;
			z-index: 9998;
		}
		.modal{
			background-color: #FFFFFF;
			border-radius: 15rpx;
			width: 70%;
			height: 260rpx;
			position: absolute;
			top: 35%;
			left: 15%;
			z-index: 9999;
			padding: 20rpx;
			box-sizing: border-box;
			.title{
				text-align: center;
				padding: 10rpx 0;
				font-size: 36rpx;
				box-sizing: border-box;
			}
			.content1{
				height: 70rpx;
				background-color: #f5f5f5;
				input{
					height: 70rpx;
					line-height: 70rpx;
					padding: 0 10rpx;
					box-sizing: border-box; 
				}
			}
			.btn-group{
				display: flex;
				height: 80rpx;
				line-height: 80rpx;
				margin-top: 10rpx;
				.coneal{
					width: 50%;
					text-align: center;
				}
				.submit{
					color: #007AFF;
					width: 50%;
					text-align: center;
				}
			}
		}
		
		
		.boxWidth{
			position: fixed;
			top: 0;
			left: 0;
			width: 100%;
			height: 100%;
			background-color:#000000;
			opacity: 0.5;
			z-index: 9998;
		}
		.modalWidth{
			background-color: #FFFFFF;
			border-radius: 15rpx;
			width: 100%;
			height: 900rpx;
			position: absolute;
			top: 15%;
			left: 0%;
			z-index: 9999;
			padding: 20rpx 30rpx;
			box-sizing: border-box;
			.title{
				text-align: center;
				padding: 10rpx 0;
				font-size: 36rpx;
				box-sizing: border-box;
			}
			.content1{
				height: 650rpx;
				//background-color: #f5f5f5;
				input{
					height: 70rpx;
					line-height: 70rpx;
					padding: 0 10rpx;
					box-sizing: border-box; 
				}
				
				.mt{
					margin-top: 20rpx;
					font-size: 28rpx;
				}
			}
			.btn-group{
				display: flex;
				height: 80rpx;
				justify-content: space-between;
				line-height: 80rpx;
				margin-top: 10rpx;
				.coneal{
					border: 1rpx solid #999999; 
					border-radius: 20rpx;
					width: 40%;
					text-align: center;
					margin-left: 40rpx;
				}
				.submit{
					color: #FFFFFF;
					background: linear-gradient(to right , #00a9e1 , #0055ff);
					border-radius: 20rpx;
					width: 40%;
					text-align: center;
					margin-right: 40rpx;
				}
			}
		}
	}
</style>
